﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;

namespace BLL
{
    public class EmployeeBLL
    {
        EmployeeDAL dal = new EmployeeDAL();

        #region 登录方法
        /// <summary>
        /// 登录方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public T Login<T>(string name, string pwd)
        {
            return Factory.CreateEmployeeDAL().Login<T>(name, pwd);
        }
        #endregion

        #region 添加
        /// <summary>
        /// 添加
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="t"></param>
        /// <returns></returns>
        public int Add<T>(T t)
        {
            return Factory.CreateEmployeeDAL().Add<T>(t);
        }
        #endregion

        #region 根据项目号修改项目状态和勘察开始时间
        /// <summary>
        /// 根据项目号修改项目状态和勘察开始时间
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Update(string ProjectNumber)
        {
            return Factory.CreateEmployeeDAL().Update(ProjectNumber);
        }
        #endregion

        #region 勘察页面的 查看详情
        /// <summary>
        /// 查看详情
        /// </summary>
        /// <returns></returns>
        public DengJi BackDatas(string ProjectNumber)
        {
            return Factory.CreateEmployeeDAL().BackDatas(ProjectNumber);
        }
        #endregion

        #region 批量添加图片
        /// <summary>
        /// 批量添加图片
        /// </summary>
        /// <param name="photo"></param>
        /// <returns></returns>
        public int Upload(EAPhoto photo)
        {
            return Factory.CreateEmployeeDAL().Upload(photo);
        }
        #endregion

        #region 审核修改状态
        /// <summary>
        /// 审核修改状态
        /// </summary>
        /// <param name="Auditing_Type"></param>
        /// <param name="ProjectNumber"></param>
        /// <returns></returns>
        public int ExamineUpdate(int Auditing_Type, string ProjectNumber)
        {
            return dal.ExamineUpdate(Auditing_Type, ProjectNumber);
        }
        #endregion

        #region 审核修改状态不成功时删除审核表中的之前添加的语句
        /// <summary>
        /// 审核修改状态不成功时删除审核表中的之前添加的语句
        /// </summary>
        /// <param name="ProjectNumber"></param>
        /// <returns></returns>
        public int ExamineDelete(string ProjectNumber)
        {
            return dal.ExamineDelete(ProjectNumber);
        }
        #endregion

    }
}
